<script setup lang="ts">
import {baseUrl, type FileVo} from "@/api/http";

defineProps({
	title: {
		type: String,
		default: ""
	},
	content: {
		type: String,
		default: ""
	},
  image: {
    type: Array<FileVo>,
    default: []
  }
})
</script>

<template>
	<scroll-view scroll-y style="height: 83vh;" >
		<view class="post_bg">
			<text class="post_header">{{title}}</text>
			
			<text class="post_content">
				{{content}}
			</text>
			
			<image mode="widthFix" v-for="i in image" :src="baseUrl + i.url"/>
			
		</view>
	</scroll-view>
</template>

<style scoped lang="scss">
.post_bg {
	.post_header {
		width: 100%;
		font-size: 60rpx;
		font-weight: bold;
		margin: 20rpx 0;
	}
	
	.post_content {
		width: 100%;
		margin: 20rpx 0;
	}
	
	image {
		width: 100%;
		height: 100% auto;
		// object-fit: contain;
		margin: 10rpx;
		border-radius: 20rpx;
	}
	
	display: flex;
	padding: 10rpx;
	flex-direction: column;
	width: 95%;
}
</style>